package com.example.notepad

import android.content.Intent
import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.example.notepad.diary.DiaryActivity
import com.example.notepad.timer.TimerActivity

class MainActivity : AppCompatActivity() {
    private var btnClockIn: Button? = null
    private var btnTimer: Button? = null
    private var btnDiary: Button? = null
    private var btnUsageData: Button? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)  // 确保你的布局文件正确

        // 绑定按钮
        btnClockIn = findViewById(R.id.btnClockIn)
        btnTimer = findViewById(R.id.btnTimer)
        btnDiary = findViewById(R.id.btnDiary)
        btnUsageData = findViewById(R.id.btnUsageData)

        // 设置按钮点击事件监听器
        btnClockIn?.setOnClickListener {
            startActivity(Intent(this@MainActivity, ClockInActivity::class.java))
        }
        btnTimer?.setOnClickListener {
            startActivity(Intent(this@MainActivity, TimerActivity::class.java))
        }
        btnDiary?.setOnClickListener {
            startActivity(Intent(this@MainActivity, DiaryActivity::class.java))
        }
        btnUsageData?.setOnClickListener {
            startActivity(Intent(this@MainActivity, UsageDataActivity::class.java))
        }
    }
}